package com.xbongbong.paas.field;

import com.xbongbong.paas.enums.SerialDateEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.Max;
import java.io.Serializable;

/**
 * @author: wufeng
 * @date: 2018/8/15 10:37
 * @desrcption: 流水号属性
 */
@Getter
@Setter
@ToString
public class SerialNumberPoJo implements Serializable {

    private static final long serialVersionUID = -3367446549829535768L;

    /**
     * 时间类型
     * @see SerialDateEnum
     */
    private String dateFormat;

    /**
     * 前缀
     */
    private String prefix;

    /**
     * 后缀
     */
    private String postfix;

    /**
     * 自增编号位数
     */
    private Integer numberDigit;

    /**
     * 起始值
     */
    @Max(value = 2147483647, message = "起始值数值过大")
    private Integer startNum;

    /**
     * 重置周期
     * 0 : 不重置
     * 1 : 每日重置
     * 2 ：每月重置
     * 3 ：每年重置
     */
    private Integer resetCycle;

    public SerialNumberPoJo(){
        numberDigit = 5;
        startNum = 1;
        resetCycle = 1;
    }
}
